import * as THREE from 'three'
import React, {useRef, useState} from 'react'
import {Canvas, useFrame, ThreeElements} from '@react-three/fiber'

function MeshDemo1() {
    // const meshRef = useRef<THREE.Mesh>(null!)
    const cubeRef = useRef<THREE.Mesh>(null!)

    useFrame(() => {
        cubeRef.current.rotation.x += 0.01;
        cubeRef.current.rotation.y += 0.01;
    });
    return (

        <mesh ref={cubeRef}>
            <boxBufferGeometry args={[1, 1, 1]}/>
            <meshBasicMaterial color="red"/>
        </mesh>

    )
}

export default MeshDemo1;